<template>
    <div class="container">
        <!-- 导航栏 -->
        <AtjHeader></AtjHeader>

        <div class="contact-container">
            <!-- 联系信息 -->
            <div class="contact-info">
                <h2>联系方式</h2>
                <div class="info-items">
                    <div class="info-item">
                        <i class="fas fa-envelope"></i>
                        <div class="item-content">
                            <h3>邮箱</h3>
                            <p>example@email.com</p>
                        </div>
                    </div>
                    <div class="info-item">
                        <i class="fas fa-phone"></i>
                        <div class="item-content">
                            <h3>电话</h3>
                            <p>+86 123 4567 8900</p>
                        </div>
                    </div>
                    <div class="info-item">
                        <i class="fas fa-map-marker-alt"></i>
                        <div class="item-content">
                            <h3>地址</h3>
                            <p>中国，北京市</p>
                        </div>
                    </div>
                </div>
                
                <!-- 社交媒体链接 -->
                <div class="social-links">
                    <a href="#" class="social-link">
                        <i class="fab fa-github"></i>
                    </a>
                    <a href="#" class="social-link">
                        <i class="fab fa-twitter"></i>
                    </a>
                    <a href="#" class="social-link">
                        <i class="fab fa-linkedin"></i>
                    </a>
                    <a href="#" class="social-link">
                        <i class="fab fa-weixin"></i>
                    </a>
                </div>
            </div>

            <!-- 联系表单 -->
            <div class="contact-form">
                <h2>给我留言</h2>
                <form id="messageForm">
                    <div class="form-group">
                        <label for="name">姓名</label>
                        <input type="text" id="name" name="name" required>
                    </div>
                    <div class="form-group">
                        <label for="email">邮箱</label>
                        <input type="email" id="email" name="email" required>
                    </div>
                    <div class="form-group">
                        <label for="subject">主题</label>
                        <input type="text" id="subject" name="subject" required>
                    </div>
                    <div class="form-group">
                        <label for="message">消息内容</label>
                        <textarea id="message" name="message" rows="6" required></textarea>
                    </div>
                    <button type="submit" class="submit-btn">发送消息</button>
                </form>
            </div>
        </div>

        <!-- 地图区域 -->
        <div class="map-section">
            <div class="map-container">
                <!-- 这里可以嵌入地图，例如使用Google Maps或百度地图 -->
                <div class="map-placeholder">地图区域</div>
            </div>
        </div>

        <footer class="footer">
            <p>&copy; 2024 我的博客. All rights reserved.</p>
        </footer>
    </div>
</template>
<script lang="ts" setup>
import { ref, defineComponent, onMounted } from 'vue';
import AtjHeader from '@/components/AtjHeader.vue'
defineComponent({
  name: 'ContactView',
});
</script>
<style lang="less" scoped>
@import '@/assets/css/universal.css';
/* 主容器样式 */
.contact-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 40px;
}

/* 联系信息样式 */
.contact-info {
    background-color: #fff;
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.contact-info h2 {
    color: #2c3e50;
    margin-bottom: 30px;
    font-size: 1.8em;
}

.info-items {
    display: flex;
    flex-direction: column;
    gap: 25px;
    margin-bottom: 40px;
}

.info-item {
    display: flex;
    align-items: flex-start;
    gap: 20px;
}

.info-item i {
    width: 40px;
    height: 40px;
    background-color: #f0f7ff;
    color: #1a73e8;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2em;
}

.item-content h3 {
    color: #2c3e50;
    margin-bottom: 5px;
    font-size: 1.1em;
}

.item-content p {
    color: #666;
    font-size: 0.95em;
}

/* 社交媒体链接 */
.social-links {
    display: flex;
    gap: 15px;
    margin-top: 30px;
}

.social-link {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #f0f7ff;
    color: #1a73e8;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.social-link:hover {
    background-color: #1a73e8;
    color: #fff;
    transform: translateY(-3px);
}

/* 联系表单样式 */
.contact-form {
    background-color: #fff;
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.contact-form h2 {
    color: #2c3e50;
    margin-bottom: 30px;
    font-size: 1.8em;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #2c3e50;
    font-weight: 500;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1em;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: #1a73e8;
    outline: none;
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.1);
}

.submit-btn {
    background-color: #1a73e8;
    color: #fff;
    padding: 12px 30px;
    border: none;
    border-radius: 25px;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.3s ease;
}

.submit-btn:hover {
    background-color: #1557b0;
    transform: translateY(-2px);
}

/* 地图区域样式 */
.map-section {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
}

.map-container {
    background-color: #fff;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.map-placeholder {
    width: 100%;
    height: 400px;
    background-color: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    font-size: 1.2em;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .contact-container {
        grid-template-columns: 1fr;
    }

    .contact-info,
    .contact-form {
        padding: 30px;
    }

    .map-placeholder {
        height: 300px;
    }
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.contact-info,
.contact-form {
    animation: fadeIn 0.8s ease forwards;
}

/* 表单验证样式 */
.form-group input:invalid,
.form-group textarea:invalid {
    border-color: #ff4d4f;
}

.form-group input:invalid:focus,
.form-group textarea:invalid:focus {
    box-shadow: 0 0 0 3px rgba(255, 77, 79, 0.1);
}
</style>